class AI1002 {
    //进攻AI:未移动且距离在600内，1s攻击一次
    constructor() {
        this.fps = 1;
    }
    run(node, dt) {
        //先判断距离
        let role = game.getRole();
        let dx = role.x - node.x;
        let dy = role.y - node.y;
        let l = dx ** 2 + dy ** 2;
        if (l < 600 ** 2) {
            //符合则发射子弹
            //一秒发射一次
            node.launchTime += dt;
            if (node.launchTime >= this.fps) {
                node.launchTime -= this.fps;
                g_MstBullet.doLaunch(node);
            }
        }
    }
};
module.exports = {
    createAI() {
        return new AI1002;
    }
}